]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
power: Fix undefined variables
authorBastien Nocera <hadess@hadess.net>
Sat, 19 Oct 2013 15:59:32 +0000 (17:59 +0200)
committerBastien Nocera <hadess@hadess.net>
Sat, 19 Oct 2013 16:00:08 +0000 (18:00 +0200)
A couple of variables that should have been gathered from the proxy
and weren't.

js/ui/status/power.js

index 69a8d20e0acb2e2ef23d18eecc6f407333e5a267..c7646fb817eb86ec108b5f8e75af3f02275d37ba 100644 (file)
@@ -79,14 +79,14 @@ const Indicator = new Lang.Class({
         let minutes = time % 60;
         let hours = Math.floor(time / 60);
 
-        if (state == UPower.DeviceState.DISCHARGING) {
+        if (this._proxy.State == UPower.DeviceState.DISCHARGING) {
             // Translators: this is <hours>:<minutes> Remaining (<percentage>)
-            return _("%d\u2236%02d Remaining (%d%%)").format(hours, minutes, percentage);
+            return _("%d\u2236%02d Remaining (%d%%)").format(hours, minutes, this._proxy.Percentage);
         }
 
-        if (state == UPower.DeviceState.CHARGING) {
+        if (this._proxy.State == UPower.DeviceState.CHARGING) {
             // Translators: this is <hours>:<minutes> Until Full (<percentage>)
-            return _("%d\u2236%02d Until Full (%d%%)").format(hours, minutes, percentage);
+            return _("%d\u2236%02d Until Full (%d%%)").format(hours, minutes, this._proxy.Percentage);
         }
 
         return null;